Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

IdeRender Class Reference

#include <deRender.hpp>

Inheritance diagram for IdeRender:

Inheritance graph
[legend]
List of all members.

Public Types

enum  RenderFlag_t {
  Render_Dot = 0, Render_Mesh, Render_Fill, Render_FillAndMesh,
  Render_DepthMesh, Render_CullCW, Render_CullCCW, Render_CullNone,
  Render_NoWaterMark, Render_WaterMark, Render_WaterMarkFade, Render_MaxFlag,
  Render_Force32 = 0x7FFFFFFF
}
 flags for indicating rendering styles More...

enum  StencilType_t {
  Stencil_Disable = 0, Stencil_DrawOn, Stencil_SetTo, Stencil_Invert,
  Stencil_Increment, Stencil_Decrement, Stencil_UseColor, Stencil_MaxFlag,
  Stencil_Force32 = 0x7FFFFFFF
}
 flag for setting render-states in a group More...


Public Member Functions

virtual deBoolean SetRenderFlag (IdeRender::RenderFlag_t Flag)=0
virtual deBoolean SetStencilState (IdeDriver *pDriver, StencilType_t Stencil, DWORD Ref, DWORD X, IdeDriver::RenderCmpFunc Comparison=IdeDriver::COMPARE_ALWAYS, IdeDriver::RenderState StencilTest=IdeDriver::RENDER_STENCILPASS, DWORD StencilMask=0xff, DWORD WriteMask=0xff)=0
virtual deBoolean Render (IdeCamera *cam, deDouble DeltaTime, deBoolean UseSG=(DE_TRUE), deBoolean ClearColorBuffer=DE_FALSE, deBoolean BeginFrame=DE_FALSE, deBoolean EndFrame=DE_FALSE)=0
virtual deBoolean RenderTexture (IdeBitmap *Target, IdeCamera *cam, deDouble DeltaTime)=0
virtual deBoolean BeginFrame (HWND WindowHandle, deBoolean ClearColorBuffer=DE_TRUE)=0
virtual deBoolean EndFrame (HWND WindowHandle, deDouble DeltaTime)=0
virtual IdeDriverCurrentPassDriver ()=0
virtual void RenderPrepBuffer (deRenderObject &obj)=0
virtual void RenderPrepBatch (long Level, IdePortal *Portal, deRect &Viewport, deTransformInfo *PortalPos, deTransformInfo *Concat)=0
virtual deDouble GetTimeStep ()=0
virtual void SetDriverPath (const char *RelativePath)=0
 set the relative path that contains Destiny3D driver files (defaults to "." which is current directory)

virtual IdeDriverLoadGetDriverLoad ()=0
 returns a pointer to internally-held IdeDriverLoad interface

virtual IdeDriverAttachToWindow (HWND hWnd, char *DriverName="Direct3D8")=0
virtual deBoolean DetachFromWindow (HWND hWnd)=0
 detach and destroy a driver attached to the specified window

virtual void UpdateWindow (HWND hWnd)=0
 update the driver's knowledge of the window's client rect, ie after a WM_SIZE message is received

virtual void UpdateDisplay ()=0
virtual deBoolean LoadDriver (HWND hWnd, IdeDriver::deDisplay *Display, char *DriverName="Direct3D8")=0
virtual deBoolean GetResolution (IdeDriver *pDriver, long Adapter, long EntryNum, long *Width, long *Height, long *RefreshRate)=0
virtual deBoolean QueryFormat (IdeDriver *pDriver, IdeDriver::deDisplay *Display, deBoolean PreferStencil=(DE_FALSE))=0
virtual void SetBGColor (deARGB color)=0
virtual void SetMaxTPortalDepth (long MaxDepth=8)=0
virtual void SetMaxLights (long MaxHWLights=32, long MaxTexLights=4)=0
virtual deBoolean ClearBackground (HWND hWnd, deARGB color=0x00000000, deBoolean ClearZ=DE_TRUE)=0
 clear the entire color-buffer to a specified color, possibly also clearing the Z-buffer

virtual void EnableTexturing (deBoolean Enabled)=0
 enable or disable texturing on all geometry rendered through this interface

virtual deBoolean Use2DCollection (HWND hWnd, Ide2DCollection *Collection)=0
virtual Ide2DCollectionGet2DCollection (HWND hWnd)=0
virtual void SetStatStruct (deRenderStats *StatStruct)=0
virtual deBoolean Screenshot (HWND hWnd, const char *filename, long ScreenSizes=1)=0
virtual long GetFrameNum ()=0

Protected Member Functions

virtual ~IdeRender (void)

Detailed Description

Interface to a high-level rendering API. IdeRender interfaces with the deScene, deDriver, and de2D modules to handle rendering of 3D scenes with 2D composite overlays. Related functions: IdeRender_GetPtr.


Member Enumeration Documentation

enum IdeRender::RenderFlag_t
 

flags for indicating rendering styles

Enumeration values:
Render_Dot  render dots (points)
Render_Mesh  render wireframe meshes
Render_Fill  render solid-filled triangles (default value)
Render_FillAndMesh  render solid-filled with wireframe on top
Render_DepthMesh  render only visible wireframe pieces
Render_CullCW  cull faces with clockwise vertex winding (default value)
Render_CullCCW  cull faces with counter-clockwise vertex winding
Render_CullNone  cull no faces according to vertex winding
Render_NoWaterMark 
Render_WaterMark 
Render_WaterMarkFade 
Render_MaxFlag 
Render_Force32 

enum IdeRender::StencilType_t
 

flag for setting render-states in a group

Enumeration values:
Stencil_Disable  No stenciling comparisons or operations.
Stencil_DrawOn  render only when stencil value is Ref. Overloads Comparison to EQUAL if ALWAYS is specified
Stencil_SetTo  set rendered pixels to stencil value Ref
Stencil_Invert  invert stencil value on rendered pixels
Stencil_Increment  increment rendered pixels' stencil values, and wrap if X is non-zero
Stencil_Decrement  decrement rendered pixels' stencil values, and wrap if X is non-zero
Stencil_UseColor  not a stencil state, call with boolean value in Ref for color buffer rendering
Stencil_MaxFlag 
Stencil_Force32 


Constructor & Destructor Documentation

virtual IdeRender::~IdeRender void    [inline, protected, virtual]
 


Member Function Documentation

virtual IdeDriver* IdeRender::AttachToWindow HWND    hWnd,
char *    DriverName = "Direct3D8"
[pure virtual]
 

attach a driver to the specified window. The driver will not be ready for rendering

Returns:
a valid IdeDriver pointer if success, NULL if failure
Parameters:
hWnd a valid window handle to attach a driver to
DriverName (optional, defualt = "Direct3D8") string containing the name of driver to use

Implemented in deRender.

virtual deBoolean IdeRender::BeginFrame HWND    WindowHandle,
deBoolean    ClearColorBuffer = DE_TRUE
[pure virtual]
 

begin a frame before rendering geometry.

Parameters:
WindowHandle the window with an attached driver to be used
ClearColorBuffer (optional, default true) if true, the color buffer will be cleared to the stored BGColor

Implemented in deRender.

virtual deBoolean IdeRender::ClearBackground HWND    hWnd,
deARGB    color = 0x00000000,
deBoolean    ClearZ = DE_TRUE
[pure virtual]
 

clear the entire color-buffer to a specified color, possibly also clearing the Z-buffer

Implemented in deRender.

virtual IdeDriver* IdeRender::CurrentPassDriver   [pure virtual]
 

Implemented in deRender.

virtual deBoolean IdeRender::DetachFromWindow HWND    hWnd [pure virtual]
 

detach and destroy a driver attached to the specified window

Implemented in deRender.

virtual void IdeRender::EnableTexturing deBoolean    Enabled [pure virtual]
 

enable or disable texturing on all geometry rendered through this interface

Implemented in deRender.

virtual deBoolean IdeRender::EndFrame HWND    WindowHandle,
deDouble    DeltaTime
[pure virtual]
 

end a frame and present the back-buffer to the screen

Parameters:
WindowHandle the window with an attached driver to be used
DeltaTime time elapsed since the last call to EndFrame

Implemented in deRender.

virtual Ide2DCollection* IdeRender::Get2DCollection HWND    hWnd [pure virtual]
 

Get the 2D collection that is being used by the driver attached to specified window. This method does NOT invoke Claim() on the returned collection, but user code may do so.

Implemented in deRender.

virtual IdeDriverLoad* IdeRender::GetDriverLoad   [pure virtual]
 

returns a pointer to internally-held IdeDriverLoad interface

Implemented in deRender.

virtual long IdeRender::GetFrameNum   [pure virtual]
 

get the current frame ID number. clamped to [0 <-> 2^31-1]

Implemented in deRender.

virtual deBoolean IdeRender::GetResolution IdeDriver   pDriver,
long    Adapter,
long    EntryNum,
long *    Width,
long *    Height,
long *    RefreshRate
[pure virtual]
 

check a driver-enumerated resolution

Returns:
false if pDriver is NULL or if Adapter or EntryNum are outside valid ranges, true otherwise
Parameters:
Width pointer to integer to store width of entry into
Height pointer to integer to store height of entry into
RefreshRate pointer to integer to store screen refresh rate (in hertz) of entry into

Implemented in deRender.

virtual deDouble IdeRender::GetTimeStep   [pure virtual]
 

Implemented in deRender.

virtual deBoolean IdeRender::LoadDriver HWND    hWnd,
IdeDriver::deDisplay   Display,
char *    DriverName = "Direct3D8"
[pure virtual]
 

load a driver up and prepare it for rendering

Returns:
true if successful, false if failure to use specified format
Parameters:
hWnd a valid window handle to attach a driver to
Display user-filled driver settings to be used in initializing the driver.
DriverName (optional, defualt = "Direct3D") string containing the name of driver to use

Implemented in deRender.

virtual deBoolean IdeRender::QueryFormat IdeDriver   pDriver,
IdeDriver::deDisplay   Display,
deBoolean    PreferStencil = (DE_FALSE)
[pure virtual]
 

a rather high-level method of finding a format close to what you want for z-buffer.

Precondition:
Adapter, Bpp, and Windowed variables in Display set to appropriate values. ZDepth and StencilDepth values in Display set to minimum acceptable bit-depth values.
Postcondition:
Display contains a valid combination of values to call LoadDriver() with. The user should check the values of ZDepth, StencilDepth, and Zpp upon failure, so that he can adjust game settings to what is possible.
Returns:
true if a format was found that satisfies criteria set, false if criteria could not be met.
Parameters:
pDriver pointer to a valid IdeDriver interface
Display pointer to a IdeDriver::deDisplay structure meeting the pre-requisites
PreferStencil upon failure to find a good format, satisfy stencil buffer needs before depth-buffer needs (if true)

Implemented in deRender.

virtual deBoolean IdeRender::Render IdeCamera   cam,
deDouble    DeltaTime,
deBoolean    UseSG = (DE_TRUE),
deBoolean    ClearColorBuffer = DE_FALSE,
deBoolean    BeginFrame = DE_FALSE,
deBoolean    EndFrame = DE_FALSE
[pure virtual]
 

Render a scene from a given vantage point, possibly doing some cleanup work with optional params

Parameters:
cam a camera containing details of how to render the scene
DeltaTime time elapsed since the last call to Render
UseSG set to true if the scenegraph is to be traversed
ClearColorBuffer (optional, default false) if true, the color buffer will be cleared to the stored BGColor
BeginFrame (optional, default false) will call BeginFrame(...) for you
EndFrame (optional, default false) will call EndFrame(...) for you

Implemented in deRender.

virtual void IdeRender::RenderPrepBatch long    Level,
IdePortal   Portal,
deRect   Viewport,
deTransformInfo   PortalPos,
deTransformInfo   Concat
[pure virtual]
 

Implemented in deRender.

virtual void IdeRender::RenderPrepBuffer deRenderObject   obj [pure virtual]
 

Implemented in deRender.

virtual deBoolean IdeRender::RenderTexture IdeBitmap   Target,
IdeCamera   cam,
deDouble    DeltaTime
[pure virtual]
 

Just like Render() except instead of rendering to the screen, it renders to a texture. the texture to be used is handled through the Target parameter, and the texture on the video hardware after the render will not match the bitmap in system memory. BeginFrame should still be called before this method, so that statistics are properly handled. The camera's viewport will be used when rendering to the texture, so the camera viewport must be the correct size for the texture being rendered into. However, the aspect ratio of the camera can be locked to something other than width/height so that the texture can be mapped in a way that doesn't require it to be viewed as square.

Parameters:
Target The bitmap which acts as the handle to the texture to be rendered into. This bitmap must have been added to the driver after having been set to have render-target capability.

Implemented in deRender.

virtual deBoolean IdeRender::Screenshot HWND    hWnd,
const char *    filename,
long    ScreenSizes = 1
[pure virtual]
 

Implemented in deRender.

virtual void IdeRender::SetBGColor deARGB    color [pure virtual]
 

set the color that the color-buffer will be cleared to. ie, 0x00102030 will set the color to 16 red intensity, 32 green intensity, and 48 blue intensity out of a maximum intensity of 255

Implemented in deRender.

virtual void IdeRender::SetDriverPath const char *    RelativePath [pure virtual]
 

set the relative path that contains Destiny3D driver files (defaults to "." which is current directory)

Implemented in deRender.

virtual void IdeRender::SetMaxLights long    MaxHWLights = 32,
long    MaxTexLights = 4
[pure virtual]
 

Implemented in deRender.

virtual void IdeRender::SetMaxTPortalDepth long    MaxDepth = 8 [pure virtual]
 

set the maximum depth of T-portal progression. Each T-Portal clears a portion of the screen as part of the rendering process, so using a high number can adversely affect your framerate. Default value = 8.

Implemented in deRender.

virtual deBoolean IdeRender::SetRenderFlag IdeRender::RenderFlag_t    Flag [pure virtual]
 

set a flag for the next call to Render to use. see IdeRender::RenderFlag_t for notes on usage

Implemented in deRender.

virtual void IdeRender::SetStatStruct deRenderStats   StatStruct [pure virtual]
 

call before BeginFrame with a user-handled instance of the structure to be filled with information. the data will be valid after a call to Render() or EndFrame()

Implemented in deRender.

virtual deBoolean IdeRender::SetStencilState IdeDriver   pDriver,
StencilType_t    Stencil,
DWORD    Ref,
DWORD    X,
IdeDriver::RenderCmpFunc    Comparison = IdeDriver::COMPARE_ALWAYS,
IdeDriver::RenderState    StencilTest = IdeDriver::RENDER_STENCILPASS,
DWORD    StencilMask = 0xff,
DWORD    WriteMask = 0xff
[pure virtual]
 

Set a pre-defined stencil method. notes on how stenciling works and what it does:
(StencilRef & StencilMask) RenderCmpFunc (StencilBufferValue & StencilMask)
That is the comparison performed for each pixel drawn when stenciling is enabled. The StencilRef value is compared with the StencilBufferValue, using a comparison function to evaluate success or failure of the test. If the stencil test fails, the operation for STENCILFAIL will be performed. If the stencil test passes and the depth-test fails, the operatation for STENCILZFAIL will be performed. If both the stencil and depth tests pass, the operation for STENCILPASS will be performed.
If modifying values in the stencil buffer, the write-mask is applied to the bits being altered. Using the StencilMaks and WriteMask, you can effectively store more than one useful "channel" of stencil information and modify it. However, there is usually a maximum of 8 bits available for use in stenciling, so not too much detail can be stored if the stencil channel is being "shared" in such a way. For Destiny3D, the aim is to perform stenciled lighting and stenciled portaling on the same geometry by sharing out the stencil buffer in this manner.

Parameters:
pDriver valid render-capable driver
Stencil any valid value of StencilType_t
Ref the StencilRef value
X a special-use flag argument, used with some stencil types to specify behavior
Comparison a comparison function for comparing current stencil value to reference value. see IdeDriver documentation for notes on how stenciling works
StencilTest the test for which the operation will be performed. Default is STENCILPASS, can also be STENCILFAIL or STENCILZFAIL
StencilMask the stenciling read-mask
WriteMask the stenciling write-mask

Implemented in deRender.

virtual void IdeRender::UpdateDisplay   [pure virtual]
 

Implemented in deRender.

virtual void IdeRender::UpdateWindow HWND    hWnd [pure virtual]
 

update the driver's knowledge of the window's client rect, ie after a WM_SIZE message is received

Implemented in deRender.

virtual deBoolean IdeRender::Use2DCollection HWND    hWnd,
Ide2DCollection   Collection
[pure virtual]
 

Specify a user-handled 2D collection for a driver attached to specified window to use. This method invokes Collection->Claim(), and then Release() on its currently held collection.

Implemented in deRender.


The documentation for this class was generated from the following file:
Generated on Mon Sep 12 20:15:58 2005 for Destiny3D by doxygen1.3-rc3